//
//  PiceMessageViewModel.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/19.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "PiceMessageViewModel.h"
#import "PiceMessageTableViewCell.h"

@interface PiceMessageViewModel ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation PiceMessageViewModel

-(instancetype)initWithViewToViewModel:(UITableView *)tableView theSuperView:(UIView *)superView{
    if (self =[super initWithViewToViewModel:tableView theSuperView:superView]) {
        CGFloat t_height;
        if (iPhoneX) {
            t_height = kHeightProportion_In_iPhoneTriploid(12) + 83;
        }else{
            t_height = kHeightProportion_In_iPhoneTriploid(44) + 49;
        }
        tableView.height = tableView.height - t_height;
        tableView.delegate = self;
        tableView.dataSource = self;
        tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeightProportion_In_iPhoneTriploid(6))];
        tableView.rowHeight = kHeightProportion_In_iPhoneTriploid(175);
        [superView addSubview:tableView];
    }
    return self;
}

#pragma mark --UITableViewDataSource,UITableViewDelegate
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    PiceMessageTableViewCell * cell = [PiceMessageTableViewCell cellWithTableView:tableView];
    return cell;
}

@end
